package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.domain.Order;

import java.util.List;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {
    
    /**
     * 根据用户ID查询订单列表
     */
    @Select("SELECT * FROM `myorder` WHERE user_id = #{userId} ORDER BY create_time DESC")
    List<Order> selectByUserId(String userId);
}
